<template> 
<li class="news-item"> 
<span>新闻 ID: {{ id }}</span> <br /> 
<span>标题：{{ title }}</span> <br /> 
<span>内容：{{ content }}</span> 
<span><button @click="delMe(id)">删除</button></span> 
</li> 
</template> 

 <script> 
 export default { 
 props: ['id', 'title', 'content'], 
 methods: { 
 delMe(id) { 
 // 调用父组件传递的方法 
 this.$emit('del', id) 
 }, 
 }, 
 } 
 </script> 
 <!-- scoped 表示样式只在当前组件生效 --> 
 <style scoped> 
 .news-item{ 
 border: 1px solid green; 
 padding: 10px; 
 } 
 </style> 
